package com.example.myapplication9_2;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class SecondActivity extends AppCompatActivity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second);
        Intent intent = getIntent();
        String name = intent.getStringExtra("name");
        String id = intent.getStringExtra("id");
        String department = intent.getStringExtra("department");
        String major = intent.getStringExtra("major");

        TextView name1 = findViewById(R.id.txt2);
        TextView id1 = findViewById(R.id.txt3);
        TextView department1 = findViewById(R.id.txt4);
        TextView major1 = findViewById(R.id.txt5);

        name1.setText("姓名： " + name);
        id1.setText("学号： " + id);
        department1.setText("院系： " + department);
        major1.setText("专业： " + major);

        name1.setTextColor(Color.RED);
        id1.setTextColor(Color.GREEN);
        department1.setTextColor(Color.GRAY);
        major1.setTextColor(Color.BLUE);
    }
}
